package com.nuoniu.sibanyun.controller.project;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nuoniu.sibanyun.common.exception.NuoNiuException;
import com.nuoniu.sibanyun.common.result.HttpResult;
import com.nuoniu.sibanyun.entity.project.DevProject;
import com.nuoniu.sibanyun.entity.project.RdTools;
import com.nuoniu.sibanyun.service.project.IDevProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.nuoniu.sibanyun.common.BaseController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 白强
 * @since 2021-08-31
 */
@RestController
@RequestMapping("/project/devProject")
@Api(tags = "研发管理_项目设置")
public class DevProjectController extends BaseController {
    @Autowired
    private IDevProjectService projectService;

    @ApiOperation("分页查询")
    @GetMapping("pageList")
    public HttpResult pageList(Page page, DevProject devProject) {
        return HttpResult.ok(projectService.pageList(page, devProject));
    }

    @ApiOperation("保存")
    @PostMapping("save")
    public HttpResult save(@RequestBody DevProject devProject) {
        projectService.saveDevProject(devProject);
        return HttpResult.ok();
    }

    @ApiOperation("删除")
    @DeleteMapping("delete")
    public HttpResult delete(Integer id) {
        projectService.delete(id);
        return HttpResult.ok();
    }

}
